#include("../../comm/FormHead.html")
<div id="main">
    <div style="margin: 10px">
        <form action="" class="layui-form" lay-filter="form">
            <input type="hidden" id="actions" name="actions" value="#(form.actions)">
            #(token??)
            <div class="layui-row">
                <div class="layui-col-md12">
                    <div class="layui-form-item">
                        <label class="layui-form-label">部门ID</label>

                        <div class="layui-input-block">
                            <input type="text" name="dept_id" placeholder="请输入部门ID" #(form.actions=='EDIT'?'readonly':'')
                                   lay-verify="dept_id" value="#(dept.dept_id)" class="layui-input #(form.actions=='EDIT'?'input-readonly':'')">
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-row">
                <div class="layui-col-md12">
                    <div class="layui-form-item">
                        <label class="layui-form-label">部门名称</label>

                        <div class="layui-input-block">
                            <input type="text" name="dept_name" required lay-verify="required" placeholder="请输入部门名称"
                                   lay-affix="clear" value="#(dept.dept_name)" class="layui-input">
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-row">
                <div class="layui-col-md12">
                    <div class="layui-form-item">
                        <label class="layui-form-label">显示顺序</label>

                        <div class="layui-input-inline" style="width:100px">
                            <input lay-skin="mynumber" min="0" type="text" required lay-verify="number" name="sindex" placeholder=""
                                   value="#(dept.sindex)" class="layui-input">
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-row">
                <div class="layui-col-md12">
                    <div class="layui-form-item">
                        <label class="layui-form-label">部门说明</label>

                        <div class="layui-input-block">
                            <textarea name="dept_desc" placeholder="请输入部门说明" class="layui-textarea" style="min-height:150px">#(dept.dept_desc)</textarea>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button type="submit" class="layui-btn" lay-submit="" lay-filter="Submit1">立即提交</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </div>
            </div>
        </form>
    </div>
</div>
<SCRIPT LANGUAGE="JavaScript">
    <!--
    layui.use(['form', 'myTool', 'myNumber'], function () {
        var form = layui.form;
        layui.myNumber.render();
        form.on('submit(Submit1)', function (data) {
            layui.myTool.post("ModifySystemDeptApi", {postdata: JSON.stringify(data.field)}, function (res) {
                top.layer.closeAll();
            });
            return false;
        });
        //较验监督方
        form.verify({
            dept_id: function (value, item) {
                if ('ADD' == $("#actions").val()) {
                    return layui.myTool.AjaxVerifyKey("CheckDeptIdApi", {values: value, dept_id: value}, '部门ID');
                }
            }
        });
    });
    //-->
</SCRIPT>
</body>
</html>